home *** CD-ROM | disk | FTP | other *** search
/ Deutsche Edition 1 / Deutsche Edition 1.iso / amok / 071-080 / amok73 / ums / interfaces / umsconsts.mod < prev   
Text File  |  1993-11-04  |  10KB  |  335 lines

  1. MODULE umsConsts;
  2.  
  3. IMPORT  Utility, sys:SYSTEM;
  4.  
  5. CONST
  6.  
  7.    NumFields *    = 128;
  8.  
  9.    (* enumeration of fields in an UMS-message *)
  10.  
  11.    msgText *    =  0;
  12.    fromName *    =  1;
  13.    fromPath *    =  2;
  14.    toName *    =  3;
  15.    toPath *    =  4;
  16.    msgID *    =  5;
  17.    creationDate*=  6;
  18.    receiveDate*    =  7;
  19.    refID *    =  8;
  20.    group *     =  9;
  21.    subject *     = 10;
  22.    attributes *    = 11;
  23.    comments *    = 12;
  24.    organisation*= 13;
  25.    distribution*= 14;
  26.  
  27. TYPE
  28.    STRPTR* = POINTER TO ARRAY MAX(INTEGER)-1 OF CHAR;
  29.    MsgTextFields* = ARRAY NumFields OF STRPTR;
  30.    MessageInfo*    = STRUCT
  31.                     hdrLen*    : LONGINT;
  32.                     txtLen*    : LONGINT;
  33.                     date*    : LONGINT;
  34.                     up*, dn*,
  35.                     lt*, rt*    : LONGINT;
  36.                     globalStat*    : LONGSET;
  37.                     userStat*    : LONGSET;
  38.                     loginStat*    : LONGSET;
  39.                     hardLink*    : LONGINT;
  40.                     softLink*    : LONGINT;
  41.                   END;
  42. CONST
  43.   EmptyMsgInfo*    = MessageInfo(0,0,0,0,0,0,0,LONGSET{},LONGSET{},LONGSET{},0,0);
  44.  
  45.   (* user status-bits *)
  46.  
  47.   archive *   = 4;  (* msg should be archived, don't delete *)
  48.   junk *      = 5;  (* negative selection, inheritance suggested *)
  49.   postPoned * = 6;  (* to be read again, (but not now) *)
  50.   selected *  = 7;  (* positive selection, inheritance suggested *)
  51.  
  52.   Old *        =  8; (* user has already read this Message *)
  53.   Read *    =  Old;
  54.   WriteAccess *    =  9; (* user may change or delete this message *)
  55.   ReadAccess *    = 10; (* user may read this message *)
  56.   ViewAccess *    = 11; (* user may read the header of this message *)
  57.   Owner *    = 12; (* user 'owns' (wrote) this message *)
  58.  
  59.   ProtectedUserFlags*= {WriteAccess,ReadAccess,ViewAccess,Owner};
  60.  
  61.   (* global status-bits *)
  62.  
  63.   Deleted *    = 0; (* msg is really deleted *)
  64.   Expired *    = 1; (* msg has expired and may be deleted *)
  65.   Exported *    = 2; (* msg has been exported *)
  66.   Orphan *    = 3; (* msg could not be exported *)
  67.   Link *    = 4; (* within a ring of linked msgs *)
  68.   HardLink *    = 5; (* link is hardLink *)
  69.  
  70.   ProtectedGlobalFlags*= {Deleted,Exported,Orphan,Link,HardLink};
  71.  
  72. (*** Errors ***)
  73.  
  74. CONST
  75.   ok*        =  0;
  76.   unknown*    =  1;
  77.  
  78.   codeMissing*    = 100;
  79.   forbiddenCode*= 101;
  80.   noWriteAccess*= 102;
  81.   noReader*    = 103;
  82.   noExporter*    = 104;
  83.   badLink*    = 105;
  84.   noWork*    = 106;
  85.   noSysop*    = 107;
  86.  
  87.   dupe*        = 200;
  88.   noReadAccess* = 201;
  89.   noViewAccess* = 202;
  90.   msgCorrupted* = 203;
  91.   noHdrSpace*    = 204;
  92.   noSuchMsg*    = 205;
  93.   badName*    = 206;
  94.   badTag*    = 207;
  95.   missingTag*    = 208;
  96.   noSuchUser*    = 209;
  97.   notFound*    = 210;
  98.   autoBounce*    = 211;
  99.   msgDeleted*    = 212;
  100.   noNetAccess*    = 213;
  101.  
  102.   serverTerminated*= 300;
  103.   cantWrite*    = 301;
  104.   cantRead*     = 302;
  105.   wrongMsgPtr*  = 303;
  106.   serverNotFree*= 304;
  107.   idCountProb*    = 305;
  108.   noLogin*    = 306;
  109.   wrongServer*    = 307;
  110.  
  111. TYPE
  112.   ErrTxt* = STRUCT num*:LONGINT; str*:STRPTR END;
  113.   ErrArr* = ARRAY 32 OF ErrTxt;
  114.  
  115. CONST
  116.   ErrorText*= ErrArr(
  117.     noNetAccess,    sys.ADR("no net-access"),
  118.     msgDeleted,        sys.ADR("msg is deleted"),
  119.     wrongServer,    sys.ADR("wrong Server Version"),
  120.     noSysop,        sys.ADR("you're not a sysop"),
  121.     autoBounce,        sys.ADR("bad msg (to be bounced) forwarded to sysop"),
  122.     noWork,        sys.ADR("no work to do"),
  123.     noSuchUser,        sys.ADR("not such user"),
  124.     notFound,        sys.ADR("not found"),
  125.     serverTerminated,    sys.ADR("server has terminated"),
  126.     missingTag,        sys.ADR("required tag missing"),
  127.     badTag,        sys.ADR("unknown or forbidden tag"),
  128.     noLogin,        sys.ADR("you're not logged in"),
  129.     noExporter,        sys.ADR("you're no exporter"),
  130.     unknown,         sys.ADR("unknown"),
  131.     codeMissing,    sys.ADR("Code missing"),
  132.     forbiddenCode,    sys.ADR("forbidden Code"),
  133.     noWriteAccess,     sys.ADR("no write-access"),
  134.     cantWrite,        sys.ADR("write error"),
  135.     dupe,        sys.ADR("dupe"),
  136.     noReadAccess,    sys.ADR("no read-access"),
  137.     noViewAccess,    sys.ADR("not visible"),
  138.     cantRead,        sys.ADR("read error"),
  139.     msgCorrupted,    sys.ADR("message is corrupted"),
  140.     wrongMsgPtr,    sys.ADR("msg-ptr does not fit"),
  141.     noHdrSpace,        sys.ADR("no space in header"),
  142.     serverNotFree,    sys.ADR("server is not free"),
  143.     idCountProb,    sys.ADR("idCount error"),
  144.     noSuchMsg,        sys.ADR("msg does not exist"),
  145.     badName,        sys.ADR("bad name or alias"),
  146.     badLink,        sys.ADR("link error"),
  147.     noReader,        sys.ADR("no one will read your msg"),
  148.     ok,         sys.ADR("ok"));
  149.  
  150. CONST
  151.  
  152.   (* tag-values *)
  153.  
  154.   (* you still MUST add Utility.user (TAG_USER) to the following values *)
  155.  
  156.   (* indicate, what type TagItem.data is of *)
  157.   (* tagXY                            -> 'LONGINT'/'LONG'               *)
  158.   (* tagXY              + typeVARPAR  -> 'POINTER TO LONGINT'/'LONG *'  *)
  159.   (* tagXY + typeSTRPTR               -> 'STRPTR'/'char *'              *)
  160.   (* tagXY + typeSTRPTR + typeVARPAR  -> 'POINTER TO STRPTR'/'char **'  *)
  161.  
  162.   typeSTRPTR *        = 2000H;
  163.   typeVARPAR *        = 4000H;
  164.  
  165.  
  166.   (** tags for ReadUMSMsg() and WriteUMSMsg() **)
  167.  
  168.   (*  add 'typeVARPAR' for ReadUMSMsg()  *)
  169.   (*  no 'typeVARPAR' for WriteUMSMsg()  *)
  170.  
  171.   tagMsgNum *         =  1;
  172.  
  173.   tagHdrLength *    =  2;
  174.   tagTxtLength *    =  3;
  175.   tagMsgDate *        =  4;   (* don't usually use when writing!      *)
  176.                                 (* Using tagMsgDate with WriteUMSMsg()  *)
  177.                                 (* has a very special meaning.          *)
  178.   tagChainUp *        =  7;
  179.   tagChainDn *        =  8;
  180.   tagChainLt *        =  9;
  181.   tagChainRt *        = 10;
  182.   tagGlobalFlags *    = 11;
  183.   tagUserFlags *    = 12;
  184.   tagLoginFlags *    = 13;
  185.   tagHardLink *        = 14;
  186.   tagSoftLink *        = 15;
  187.  
  188.   tagDateStyle *    = 64;    (* style for receiveDate when reading:        *)
  189.                 (* data = 0: no receiveDate            *)
  190.                 (* data = 1: emulate old-style receiveDate    *)
  191.   tagAutoBounce *    = 65;    (* when writing:                *)
  192.                 (* data # 0: server returns error 'autoBounce',    *)
  193.                 (*           but still keeps the Msg and sends    *)
  194.                 (*           it to the sysops.            *)
  195.   tagHdrFill *        = 66;   (* when writing: how much bytes to be reserved    *)
  196.   tagTxtFill *        = 67;    (*               for header and text        *)
  197.   tagIDStyle *        = 68;    (* style for Message-ID                *)
  198.                  (* data = 0: real Message-ID            *)
  199.                                 (* data = 1: old style dec-number        *)
  200.   tagNoUpdate *        = 69;    (* data = 0: (default) set 'Old'-Flag when      *)
  201.                 (*           reading or writing            *)
  202.                 (* data = 1: don't touch 'Old'-Flag        *)
  203.  
  204.   tagMsgText *        =  256 + typeSTRPTR;
  205.   tagFromName *        = tagMsgText + 1;
  206.   tagFromPath *        = tagMsgText + 2;
  207.   tagToName *        = tagMsgText + 3;
  208.   tagToPath *        = tagMsgText + 4;
  209.   tagMsgID *        = tagMsgText + 5;
  210.   tagCreationDate *    = tagMsgText + 6;
  211.   tagReceiveDate *    = tagMsgText + 7;
  212.   tagRefID *        = tagMsgText + 8;
  213.   tagGroup *        = tagMsgText + 9;
  214.   tagSubject *        = tagMsgText +10;
  215.   tagAttributes *    = tagMsgText +11;
  216.   tagComments *        = tagMsgText +12;
  217.   tagOrganisation *    = tagMsgText +13;
  218.   tagDistribution *    = tagMsgText +14;
  219.  
  220.   (* tagMsgText+15 .. tagMsgText+127 are also usable as text-fields *)
  221.  
  222.   tagMsgInfo *        = 512;
  223.                 (* datatype: POINTER TO MessageInfo *)
  224.   tagTextFields *    = tagMsgInfo + 1;
  225.                 (* datatype: POINTER TO MsgTextFields *)
  226.  
  227.   tagReadHeader *    = tagMsgInfo + 2;
  228.                 (* read all header-fields *)
  229.   tagReadAll *        = tagMsgInfo + 3;
  230.                 (* read all text-fields *)
  231.  
  232.  
  233.   (** tags for UMSSelect()  **)
  234.  
  235.   tagSelSet *        = 1024;
  236.                 (* flags to set on selected msgs *)
  237.   tagSelUnset *        = tagSelSet + 1;
  238.                 (* flags to clear *)
  239.   tagSelWriteGlobal *    = tagSelSet + 2;
  240.                 (* change global flags, not user-flags *)
  241.   tagSelWriteLocal *    = tagSelSet + 3;
  242.                 (* change login-local flags, not user-flags *)
  243.   tagSelWriteUser *    = tagSelSet + 4+typeSTRPTR;
  244.                 (* change other user's flags *)
  245.  
  246.   tagSelStart *        = tagSelSet + 8;
  247.                 (* process only msgs AFTER this one *)
  248.   tagSelStop *        = tagSelSet + 9;
  249.                 (* process only msgs BEFORE this one *)
  250.  
  251.   (* the following are mutual-exclusiv *)
  252.   (*   use only one of the following operations,   *)
  253.   (*   otherwise unpredictable things may happen!  *)
  254.  
  255.   tagSelReadGlobal *    = tagSelSet +10;
  256.                 (* examine global flags, not user-flags *)
  257.   tagSelReadLocal *    = tagSelSet +11;
  258.                 (* examine login-local flags, not user-flags *)
  259.   tagSelReadUser *    = tagSelSet +12+typeSTRPTR;
  260.                 (* examine other user's flags *)
  261.   tagSelMask *        = tagSelSet +16;
  262.                 (* select msgs, that's flags    *)
  263.   tagSelMatch *        = tagSelSet +17;
  264.                 (*   ANDed with mask equal match *)
  265.   tagSelParent *    = tagSelSet +18;
  266.                 (* examine parent's flags *)
  267.  
  268.   tagSelDate *        = tagSelSet +19;
  269.                 (* select msgs younger than this date *)
  270.  
  271.   tagSelTree *        = tagSelSet +29;
  272.                 (* select whole tree this msg is in *)
  273.  
  274.   tagSelSubTree *    = tagSelSet +21;
  275.                 (* select sub-tree this msg is root of *)
  276.  
  277.   tagSelMsg *        = tagSelSet +22;
  278.                 (* select a msg specified by number *)
  279.  
  280.   tagSelQuick *        = tagSelSet +23;
  281.                 (* quick select enabled *)
  282.   (* tagMsgText .. tagMsgText+127 are also allowed for selecting *)
  283.  
  284.  
  285.   (** tags for UMSSearch() **)
  286.  
  287.   tagSearchLast *    = 2048;
  288.                 (* number of LAST msg not to search *)
  289.   tagSearchQuick *    = tagSearchLast+ 1;
  290.                 (* quick searches enabled *)
  291.  
  292.   tagSearchGlobal *    = tagSearchLast+ 2;
  293.                 (* examine global flags instead of user-flags*)
  294.   tagSearchLocal *    = tagSearchLast+ 3;
  295.                 (* examine login-local flags, not user-flags *)
  296.   tagSearchUser *    = tagSearchLast+ 4+typeSTRPTR;
  297.                 (* examine other user's flags *)
  298.   tagSearchDirection *    = tagSearchLast+ 5;
  299.                 (* set search direction *)
  300.                 (*  0 = default  *)
  301.                 (*  1 = forward  *)
  302.                 (* -1 = backward *)
  303.  
  304.   (* the following are mutual-exclusiv *)
  305.   (*   use only one of the following operations,   *)
  306.   (*   otherwise unpredictable things may happen!  *)
  307.  
  308.   tagSearchMask *    = tagSearchLast+16;
  309.                 (* search a msg, that's flags   *)
  310.   tagSearchMatch *    = tagSearchLast+17;
  311.                 (*   ANDed with mask equal match *)
  312.  
  313.   (* tagMsgText .. tagMsgText+127 are also allowed for searching *)
  314.  
  315.  
  316.   (**  tags for ReadUMSConfig(), WriteUMSConfig()  **)
  317.  
  318.   tagCfgGlobalOnly *    = 3072; (* read only global config,                  *)
  319.                   (* thus must not be combined with tagCfgUser *)
  320.   tagCfgName *        = tagCfgGlobalOnly+ 1 + typeSTRPTR;
  321.                   (* name of config var to read                *)
  322.   tagCfgUser *        = tagCfgGlobalOnly+ 2 + typeSTRPTR;
  323.                   (* name of user to read locals from          *)
  324.   tagCfgUserName *    = tagCfgGlobalOnly+ 3 + typeSTRPTR;
  325.                   (* alias to get realname from                *)
  326.  
  327.  
  328.   (**  tags for WriteUMSConfig()  **)
  329.  
  330.   tagCfgDump *        = tagCfgGlobalOnly+16 + typeSTRPTR;
  331.                   (* write current settings to a file *)
  332.  
  333.  
  334. END umsConsts.
  335.